<%@ include file="common.jsp" %>

<script type="text/javascript">
		$(document).ready(function(){
			var height = $("#documentLookUpTable").height();
			if(height && height > 400){
				$("#documentLookUpFiltersDiv").dialog("option","height",500);
			}else{
				$("#documentLookUpFiltersDiv").dialog("option","height",'auto');
			}
		});
	</script>

<hr/>
<div id="docSearchResultsDiv">
		<div style= "color: RED; font-size: medium;">
			<c:out value="${docerrorMsg}"></c:out>
		</div>
	
  		<form name="docSubmit" id="docSubmit">
  			<table class="viewDetails">
				<tr class="heading">
					<th>Select</th>
					<th>Name</th> 
					<th>Code</th>
					<th>Type</th> 
					<th>Category</th> 
					<th>Sub-Category</th>
					<th>Business Unit</th>	<!-- changed from location to business unit on 25-02-2012 as told by shubh -->
					<th>Department</th>
				</tr>
  				<c:forEach var="tab" items="${docdetailsList}" varStatus="loop">
  					
  					<c:set var="tabColor" value="odd"></c:set>
				     	<c:if test="${(loop.index % 2) eq 0}">
				        	<c:set var="tabColor" value="even"></c:set>
				        </c:if>
  				
					<tr class="${tabColor}">
						<td align="center"> <input type="radio" id="radio" name="radio" value="${tab.docName},${tab.docId},${tab.docCategoryId},${tab.docSubCategoryId}, ${tab.docLocId}, ${tab.docDepttId},${docTypeName[tab.docTypeId]}, ${docCatName[tab.docCategoryId]}, ${docSubCatName[tab.docSubCategoryId]},${locName[tab.docLocId]}, ${deptName[tab.docDepttId]}, ${tab.documentStatus}" /> </td>
						<td align="center">${tab.docName}</td> 
						<td align="center">${tab.docCode}</td>
						<td align="center" id="docTypeName">${docTypeName[tab.docTypeId]}</td>
						<td align="center" id="category">${docCatName[tab.docCategoryId]} </td> 
						<td align="center" id="subCategory">${docSubCatName[tab.docSubCategoryId]} </td> 
						<td align="center" id="locName">${locName[tab.docLocId]} </td>
						<td align="center" id="deptName">${deptName[tab.docDepttId]} </td>
					</tr>
				</c:forEach>
			</table>
			<table style="width: 90%;">
				<tr class="formSpacingRow">
					<td></td>
				</tr>
				<tr style="width: 100%;">
					<td style="width: 100%;" align="center">
						<input type="button" value="Select Document" onclick="submitSearchDocumentDetails();" class="formButton" />
					</td>
				</tr>
			</table>
											  
		</form>
</div>